package sound;

import logic.DelayedController;

import com.jme.scene.Spatial;

public class MovingSoundController extends DelayedController {
	
	private static final long serialVersionUID = 1L;
	
	protected Spatial noiseSource;
	protected String source;
	
	public MovingSoundController(Spatial noiseSource, String source) {
		super(1f);
		this.noiseSource = noiseSource;
		this.source = source;
		
		noiseSource.addController(this);
	}
	
	@Override
	public void delayedUpdate(float time) {
		AudioManager.get().updateMovingNoise(source, noiseSource.getLocalTranslation());
	}
}